package com.kedi.homeservicecenter.service.impl;

import com.kedi.homeservicecenter.read.dao.mapper.OldlifeMapper;
import com.kedi.homeservicecenter.service.OpusePraColService;
import com.kedi.homeservicecenter.write.dao.mapper.WriteOldlifeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

/**
 * 
* @Description: 
* @author: dw 
* @date: 2019 2019年7月22日 下午1:25:02
 */
@Service
public class OpusePraColServiceImpl implements OpusePraColService {
    @Autowired
    private WriteOldlifeMapper mapper;
   
    @Autowired
    private OldlifeMapper oldlifeMapper;


    /**
    * 方法实现说明 点赞+1
    * @author      ytw
    *@param         map
    * @return
    * @exception
    * @date        2019/7/31 22:18
    */
    @Transactional(rollbackFor=Exception.class)
    @Override
    public int updatePraise(Map map) {

        mapper.updatePraise(map);
       return mapper.createpraise(map);

    }
    /**
    * 方法实现说明  收藏+1
    * @author      ytw
    *@param         map
    * @return
    * @exception
    * @date        2019/7/31 22:18
    */
    @Transactional(rollbackFor=Exception.class)
    @Override
    public int updateCollection(Map map) {

        mapper.updateCollection(map);
       return mapper.createcolection(map);
    }

    /**
    * 方法实现说明
    * @author      ytw
    *@param             id
    * @return
    * @exception
    * @date        2019/7/31 22:18
    */
    @Override
    public Map selectOpusUserId(Integer id) {
        return  oldlifeMapper.selectOpusUserId(id);
    }

}
